package com.xnyzc.lhy.finance.entity.invoice.response;

import com.xnyzc.lhy.common.penum.invoice.EInvoiceErrorCode;
import lombok.Data;

import java.io.Serializable;

/**
 * 发票错误信息
 */
@Data
public class InvoiceErrorResponse implements Serializable {
    /**
     * 错误代码
     */
    private String errno;

    /**
     * 错误消息
     */
    private String errmsg;

    public InvoiceErrorResponse(String errno, String errmsg){
        this.errno = errno;
        this.errmsg = errmsg;
    }

    public InvoiceErrorResponse(EInvoiceErrorCode eInvoiceErrorCode){
        this.errno = eInvoiceErrorCode.getValue().toString();
        this.errmsg = eInvoiceErrorCode.getDesc();
    }
}
